<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	fullLotNo	= Request("fullLotNo")
	lotSubNo	= Request("lotSubNo")
	types		= Request("type")
	rank		= Request("rank")

	
	SQLTitle = "-- ■■■■ 측정 결과 정보 그리드 List up ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 

	SQL = "SELECT priority, visual, flag, memo,  CONVERT(VARCHAR(10),result1) result1, " & _
		  " CONVERT(VARCHAR(10),result2) result2, " & _
		  " CONVERT(VARCHAR(10),result3) result3, " & _
		  " CONVERT(VARCHAR(10),result4) result4, " & _
		  " CONVERT(VARCHAR(10),result5) result5, " & _
		  " CONVERT(VARCHAR(10),result6) result6, " & _
		  " CONVERT(VARCHAR(10),result7) result7, " & _
		  " CONVERT(VARCHAR(10),result8) result8, " & _
		  " CONVERT(VARCHAR(10),result9) result9, " & _
		  " CONVERT(VARCHAR(10),result10) result10, " & _
		  " CONVERT(VARCHAR(10),result11) result11, " & _
		  " CONVERT(VARCHAR(10),result12) result12, " & _
		  " CONVERT(VARCHAR(10),result13) result13, " & _
		  " CONVERT(VARCHAR(10),result14) result14, " & _
		  " CONVERT(VARCHAR(10),result15) result15, " & _
		  " CONVERT(VARCHAR(10),result16) result16, " & _
		  " CONVERT(VARCHAR(10),result17) result17, " & _
		  " CONVERT(VARCHAR(10),result18) result18, " & _
		  " CONVERT(VARCHAR(10),result19) result19, " & _
		  " CONVERT(VARCHAR(10),result20) result20 " & _
		  "FROM tblCheckingResult WHERE fullLotNo='" & fullLotNo & "' AND lotSubNo=" & lotSubNo & " AND type='" & types & "' AND rank=" & rank & " AND flag='Y' ORDER BY priority" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<CheckingResult>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			If lotSubNo = "0" Then 
				subLot = ""
			Else
				subLot = "-" & lotSubNo
			End If 

			lotNo = fullLotNo & subLot & "." & rs("priority")
			Response.write "	<Results>" & vbcrlf
				Call mkXMLNode("priority",rs("priority"), 2)
				Call mkXMLNode("lotNo",lotNo, 2)
				Call mkXMLNode("visual", rs("visual"), 2)
				Call mkXMLNode("result1", rs("result1"), 2)
				Call mkXMLNode("result2", rs("result2"), 2)
				Call mkXMLNode("result3", rs("result3"), 2)
				Call mkXMLNode("result4", rs("result4"), 2)
				Call mkXMLNode("result5", rs("result5"), 2)
				Call mkXMLNode("result6", rs("result6"), 2)
				Call mkXMLNode("result7", rs("result7"), 2)
				Call mkXMLNode("result8", rs("result8"), 2)
				Call mkXMLNode("result9", rs("result9"), 2)
				Call mkXMLNode("result10", rs("result10"), 2)
				Call mkXMLNode("result11", rs("result11"), 2)
				Call mkXMLNode("result12", rs("result12"), 2)
				Call mkXMLNode("result13", rs("result13"), 2)
				Call mkXMLNode("result14", rs("result14"), 2)
				Call mkXMLNode("result15", rs("result15"), 2)
				Call mkXMLNode("result16", rs("result16"), 2)
				Call mkXMLNode("result17", rs("result17"), 2)
				Call mkXMLNode("result18", rs("result18"), 2)
				Call mkXMLNode("result19", rs("result19"), 2)
				Call mkXMLNode("result20", rs("result20"), 2)
				Call mkXMLNode("memo", rs("memo"), 2)
				Call mkXMLNode("flag", rs("flag"), 2)
			Response.write "	</Results>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</CheckingResult>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>